<style>
#Test
{
    position: absolute;
    height: auto;
    width: auto;
}
#color{
    background-color: yellow;
}
</style>
<span id="Tests">
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
</span>
<div id="color">&nbsp;</div>

<script>
    var test = document.getElementById("Tests");
//    test.style.fontSize = 12;
    var height = (test.clientHeight + 1) + "px";
    var width = (test.clientWidth + 1) + "px";    
    var clr_div = document.getElementById("color");
    clr_div.style.width=width;
</script>
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<span id="sestss" 
     style="position:absolute; 
            left:150; 
            top:100; 
            height:200; 
            background-color:blue;">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
</span>
<button onclick="alert(document.getElementById('sestss').clientWidth);">clientWidth</button>&nbsp;
<br>
<br>